import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:photo_view/photo_view.dart';

class ImageHeroOne extends StatefulWidget {
  final String imageUrl;
  final String tagId;
  const ImageHeroOne({super.key, required this.imageUrl, required this.tagId});

  @override
  State<ImageHeroOne> createState() => _ImageHeroState();
}

class _ImageHeroState extends State<ImageHeroOne> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: GestureDetector(
        onTap: () {
          Navigator.pop(context);
        },
        child: AnnotatedRegion<SystemUiOverlayStyle>(
          value: SystemUiOverlayStyle.light,
          child: Hero(
            tag: widget.tagId,
            child: PhotoView(
              imageProvider: NetworkImage(widget.imageUrl),
            ),
          ),
        ),
      ),
    );
  }
}
